package com.xjh.utils.beanutils.internal.convertors;

import com.xjh.utils.beanutils.BeanCopyConvertor;

/**
 * Enum转字符串数组转换器
 *
 * @company 湖南省安第斯信息科技有限公司, 版权所有
 * @author kevin
 * @date 2021/3/10
 */
@SuppressWarnings("rawtypes")
public class EnumToStringArrayConvertor implements BeanCopyConvertor<Enum[], String[]> {

	@Override
	public String[] convertTo(Enum[] object) {
		if( object == null )
			return null;
		String[] retList = new String[object.length];
		int i =0;
		for( Enum enum1 : object ) {
			retList[i++] = enum1.toString();
		}
		return retList;
	}

}
